<script>
	import Vue from 'vue'
	import core from "@/static/core.js"
	export default {
		onLaunch: function(options) {
			console.log('App Launch');
			if(typeof(options.query.debug)!='undefined') core.debug = options.query.debug=='yes' ? true : false;
			let userstate = typeof(options.query.state)=='undefined' ? '' : options.query.state;
			core.init(userstate);
			if(typeof(options.query.fromuid)!='undefined' && options.query.fromuid>0 && core.agentid==0) core.agentid = options.query.fromuid;
			uni.getSystemInfo({
				success: function(e) {
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
						core.device = 'ios';
					};
					// #endif
					// #ifdef MP-WEIXIN
					Vue.prototype.StatusBar = e.statusBarHeight;
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
					// #endif       
					// #ifdef MP-ALIPAY
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				}
			})
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
	@import "static/colorui/main.css";
	@import "static/colorui/icon.css";
	@import "static/style.css";
</style>
